1. Field of the Invention
The present invention relates to a system and a method for connecting virtual machines, particularly relates a connection method used in a cloud system for setting up switches in a cloud system such that all virtual machines in the same virtual local area network are able to establish connection with and transfer data packets to each other.
2. Description of Related Art
The current cloud system is composed of a plurality of switches and a plurality of physical hosts (PMs). FIG. 1 is a schematic diagram of a cloud system in the related art. In FIG. 1, there are four switches 11-14 and three physical hosts 21-23 used in the system.
Each switch 11-14 all has a plurality of connecting ports. Each switch 11-14 respectively inter-connects and connects with the physical hosts 21-23 via the connecting ports on the switch. As shown in FIG. 1, the switch 11 connects with the physical host 21 and the switch 12 via the connecting port of the switch. The switch 12 connects with the physical host 22, the switch 11 and 13. The switch 13 connects with the switch 12 and 14. The switch 14 connects with the switch 13 and the physical host 23.
The physical host 21-23 respectively pertains to different Local Area Network (LAN). As shown in FIG. 1, the physical host 21 and 23 pertains to LAN1, and the physical host 22 pertains to LAN2. In the embodiment, the physical host 21 and 23 establishes connection with each other for inter-transferring data packets. The physical host 22 only establish connection with other physical hosts (not shown in the diagram) pertained to the same LAN2, and cannot connect with the physical hosts 21 and 23.
Generally, the switches 11-14 set up LAN tag of the connecting port on the switches for confirming the data packets transmission of which LAN from the connecting ports is respectively permitted. As shown in FIG. 1, the physical hosts 21 and 23 establish connection, because corresponding connecting ports of the switches 11-14 are all attached with LAN1 tag. In other words, the connecting ports tagged “1” permit data packets transmission of the LAN1.
In further details, several virtual machines (VM) (not shown in the diagram) are respectively created on the physical hosts 21-23, and the virtual machines pertain to different virtual local area networks (VLAN). Several virtual machines of the same physical host share the same network cable for connecting to the same connecting port of the same switch.
Currently, administrators record which connecting ports on the switches 11-14 respectively connects to which physical hosts 21-23, and which physical hosts 21-23 respectively pertains to which LANs. Further, the LAN tags of connecting ports of the switches 11-14 are manually set up for establish connections with physical hosts pertained to the same LAN.
Nonetheless, different from the stable characteristic of physical hosts after the installation, virtual machines typically are created, migrated and deleted frequently. Along with the virtual machines changes, the switches 11-14 are required to update the setup of the VLAN tags.
As mentioned above, using manual operations to setup and manage the VLAN tags are slow and unable to keep up with the changes of the virtual machines. Because the quantity of virtual machines in a cloud system is numerous, the risk incorrect setup resulted from human errors leading to network glitches is increasing accordingly.